package UPPM;

import java.util.ResourceBundle;
import java.util.concurrent.TimeUnit;
import junit.framework.Assert;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

import UPPM.Utils;

public class TestStaticLinks 
{
	private void syso() {
		System.out.println("Testing TestStaticLinks");
	}

	WebDriver driver = new FirefoxDriver();

	@Before
	public void setUp() throws Exception {
		driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
		driver.manage().window().maximize();
		driver.get("http://test.unippmtest.co.uk");		
		}

	@Test
	public void testStaticLinksInitialStateNotLoggedIn() throws Exception {
		
		//Contact Us
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Contact Us")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("UK Team & Contact Info")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Worldwide Offices")));
		//Info
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("About Us")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Company History")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Licensing")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Our Composers")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Album Reviews")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Latest News")));

		//Follow Us
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Follow Us")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Facebook")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Twitter")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Google+")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("YouTube")));
		//Help
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Help")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Music Search Assistance")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("FAQs")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Website User Guide")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("System Requirements")));
		
		//Privacy Policy and T&Cs
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Privacy & Terms")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Cookies Policy")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Privacy Policy")));
		Assert.assertEquals(true, Utils.isElementPresent(driver, By.linkText("Terms & Conditions")));
		
	}

	
	
	@After
	public void tearDown() throws Exception {
		//driver.quit();
	}
}

